﻿<UserControl
	x:Class="VivendoByteToolkit.Controls.DatePicker"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
	xmlns:vm="using:VivendoByteToolkit.ViewModels"
	xmlns:helper="using:VivendoByteToolkit.Helpers">
	
	<UserControl.Resources>
		<Style TargetType="TextBlock">
			<Setter Property="VerticalAlignment" Value="Center" />
			<Setter Property="HorizontalAlignment" Value="Center" />
		</Style>
		<vm:DatePickerViewModel x:Key="viewmodel" />
	</UserControl.Resources>

	<Grid Height="Auto" Width="Auto" DataContext="{StaticResource viewmodel}">
		<StackPanel Orientation="Horizontal" VerticalAlignment="Center"
					HorizontalAlignment="Center">
			
			<Border BorderBrush="Black" BorderThickness="2" Margin="2">
                <Grid Margin="0" helper:DoubleTappedCommandHelper.Command="{Binding EnableKeyboardCommand}">
				<TextBlock Text="{Binding Day}" Margin="8 0 8 0"
						   helper:HoldCommandHelper.Command="{Binding TodayCommand}"
						   helper:TapCommandHelper.Command="{Binding SwitchDayCommand}"
						   helper:SwipeCommandHelper.Up="{Binding IncrementDayCommand}"
						   helper:SwipeCommandHelper.Down="{Binding DecrementDayCommand}"
						   helper:SwipeCommandHelper.Right="{Binding SkipUpDayCommand}"
						   helper:SwipeCommandHelper.Left="{Binding SkipDownDayCommand}"
						   helper:WheelCommandHelper.Up="{Binding IncrementDayCommand}"
						   helper:WheelCommandHelper.Down="{Binding DecrementDayCommand}" />
                </Grid>
            </Border>

			<Border BorderBrush="Black" BorderThickness="2" Margin="2">
				<TextBlock Text="{Binding Month}" Margin="8 0 8 0"
						   helper:HoldCommandHelper.Command="{Binding TodayCommand}"
						   helper:SwipeCommandHelper.Up="{Binding IncrementMonthCommand}"
						   helper:SwipeCommandHelper.Down="{Binding DecrementMonthCommand}"
						   helper:SwipeCommandHelper.Right="{Binding SkipUpMonthCommand}"
						   helper:SwipeCommandHelper.Left="{Binding SkipDownMonthCommand}"
						   helper:WheelCommandHelper.Up="{Binding IncrementMonthCommand}"
						   helper:WheelCommandHelper.Down="{Binding DecrementMonthCommand}" />
			</Border>

			<Border BorderBrush="Black" BorderThickness="2" Margin="2">
				<TextBlock Text="{Binding Year}" Margin="8 0 8 0"
						   helper:HoldCommandHelper.Command="{Binding TodayCommand}"
						   helper:SwipeCommandHelper.Up="{Binding IncrementYearCommand}"
						   helper:SwipeCommandHelper.Down="{Binding DecrementYearCommand}"
						   helper:SwipeCommandHelper.Right="{Binding SkipUpYearCommand}"
						   helper:SwipeCommandHelper.Left="{Binding SkipDownYearCommand}"
						   helper:WheelCommandHelper.Up="{Binding IncrementYearCommand}"
						   helper:WheelCommandHelper.Down="{Binding DecrementYearCommand}" />
			</Border>
		</StackPanel>
	</Grid>
</UserControl>